
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>erract_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>erract_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void erract_c ( ConstSpiceChar * op,
                   SpiceInt         lenout,
                   SpiceChar      * action )

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
   Retrieve or set the default error action.
</PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
   <a href="../req/error.html">ERROR</a>
</PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
   ERROR


</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
   VARIABLE  I/O  DESCRIPTION
   --------  ---  --------------------------------------------------
   op         I   Operation -- &quot;GET&quot; or &quot;SET&quot;
   lenout     I   Length of list for output.
   action    I/O  Error response action
</PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
   op       indicates the operation -- &quot;GET&quot; or &quot;SET&quot;.  &quot;GET&quot; means,
            &quot;Set action to the current value of the error response
            action.&quot;  &quot;SET&quot; means, &quot;update the error response action to
            the value indicated by action.&quot;

            op may be in mixed case; for example,

               <b>erract_c</b> ( &quot;gEt&quot;, lenout, action );

            will work.

   lenout   is the string size of output 'action' when op equals &quot;GET.&quot;
            The size described by lenout should be large enough to 
            hold all characters of any possible output string 
            plus 1 (to accommodate the C null terminator).

   action   is an input argument when op is &quot;SET.&quot;  It takes the 
            values,  &quot;ABORT&quot;,  &quot;IGNORE&quot;, &quot;REPORT&quot;, &quot;RETURN&quot;, and 
            &quot;DEFAULT&quot;.

            Briefly, the meanings of the error response
            choices are as follows:

            1.  &quot;ABORT&quot;  --  When an error is detected by a
                             CSPICE routine, or when
                             ANY routine signals detection
                of an error via a call to <a href="sigerr_c.html">sigerr_c</a>, the
                toolkit will output any error messages that
                it has been enabled to output (see <a href="errprt_c.html">errprt_c</a>
                and <a href="errdev_c.html">errdev_c</a> also ), and then execute an
                exit statement.

            2.  &quot;REPORT&quot; --  In this mode, the toolkit does
                             NOT abort when errors are detected.
                             When <a href="sigerr_c.html">sigerr_c</a> is called to report
                an error, all error messages that the toolkit
                is enabled to output will be sent to the
                designated error output device.  Similarly,
                a call to <a href="setmsg_c.html">setmsg_c</a> will result in the long
                error message being output, if the toolkit
                is enabled to output it.


            3.  &quot;RETURN&quot; --  In this mode, the toolkit also
                             does NOT abort when errors are
                             detected.  Instead, error messages
                are output if the toolkit is enabled to do
                so, and subsequently, ALL TOOLKIT ROUTINES
                RETURN IMMEDIATELY UPON ENTRY until the
                error status is reset via a call to RESET.
                (No, RESET itself doesn't return on entry).
                Resetting the error status will cause the
                toolkit routines to resume their normal
                execution threads.



            4.  &quot;IGNORE&quot; --  The toolkit will not take any
                             action in response to errors;
                             calls to <a href="sigerr_c.html">sigerr_c</a> will have no
                             effect.


            5.  &quot;DEFAULT&quot; -- This mode is the same as &quot;ABORT&quot;,
                             except that an additional error
                             message is output.  The additional
                             message informs the user that the
                             error response action can be
                             modified, and refers to documentation
                             of the error handling feature.


            action may be in mixed case; for example,

                <b>erract_c</b> ( &quot;SET&quot;, lenout,&quot;igNORe&quot; );

            will work.
</PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
   action   is an output argument returning the current error 
            response action when 'op' equals &quot;GET.&quot;  Possible values 
            are:  &quot;ABORT&quot;, &quot;REPORT&quot;, &quot;RETURN&quot;, and &quot;IGNORE&quot;.
            See &quot;Detailed Input&quot; for descriptions of these values.
</PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
   1) If the input argument op does not indicate a valid operation,
      the error SPICE(INVALIDOPERATION) will be signaled.

   2) When op is &quot;SET&quot;, if the input argument action does not indicate a
      valid error handling action, the error SPICE(INVALIDACTION) will
      be signaled.

   3) The error SPICE(EMPTYSTRING) is signaled if either input string
      does not contain at least one character, since an input string
      cannot be converted to a Fortran-style string in this case.  This
      check always applies to op; it applies to action only when
      action is an input, that is, when op is &quot;SET.&quot;

   4) The error SPICE(NULLPOINTER) is signaled if either string pointer
      argument is null.

   5) The caller must pass a value indicating the length of the output
      string, when action is an output.  If this value is not at least
      2, the error SPICE(STRINGTOOSHORT) is signaled.
</PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
   As indicated in the &quot;detailed input&quot; section above, the choices for
   the Toolkit's error handling action are designated by the strings
   &quot;ABORT&quot;, &quot;REPORT&quot;, &quot;RETURN&quot;, &quot;IGNORE&quot;, and &quot;DEFAULT&quot;.  These
   choices control the way the toolkit behaves when an error is
   detected.  The toolkit thinks an error has been detected when
   <a href="sigerr_c.html">sigerr_c</a> is called.

   1.  &quot;ABORT&quot;   In this mode, the toolkit sends error messages
        to the error output device and then stops.
        This is the default mode.  It is probably
        the one to choose for running non-interactive programs.
        You may also wish to use this for programs which
        have many bugs, or in other cases where continued
        operation following detection of an error isn't useful.

   2.  &quot;REPORT&quot;  In this mode, the toolkit sends error messages
        to the error output device and keeps going.  This mode
        may be useful if you are debugging a large program,
        since you can get more information from a single test run.
        You will probably want to use <a href="errdev_c.html">errdev_c</a> to indicate a file
        where your error messages should be sent.

   3.  &quot;RETURN&quot;  In this mode, the toolkit also sends error messages
        to the error output device and &quot;keeps going&quot;.  But
        instead of following their normal execution threads,
        the toolkit routines will simply return immediately upon
        entry, once an error has been detected.
        The availability of this feature makes it safe to call
        multiple toolkit routines without checking the error
        status after each one returns; if one routine detects
        an error, subsequent calls to toolkit routines will have
        no effect; therefore, no crash will occur.  The error
        messages set by the routine which detected the error
        will remain available for retrieval by getmsg_.

   4.   &quot;IGNORE&quot;  This mode can be dangerous!  It is best
        used when running a program whose behavior you
        understand well, in cases where you wish to suppress
        annoying messages.  BUT, if an unexpected error
        occurs, you won't hear about it from anyone, except
        possibly your run-time system.

   5.  &quot;DEFAULT&quot;  As the name suggests, this is the default
        error handling mode.  The error handling mechanism
        starts out in this mode when a program using the
        toolkit is run, and the mode remains &quot;DEFAULT&quot; until
        it is changed via a call to this routine.
        This mode is the same as &quot;ABORT&quot;,
        except that an additional error message is output.
        The additional message informs the user that the
        error response action can be modified, and refers
        to documentation of the error handling feature.


   NOTE:

        By default, error messages are printed to the screen
        when errors are detected.  You may want to send them
        to a different output device, or choose a subset to
        output.  Use the routines <a href="errdev_c.html">errdev_c</a> and <a href="errprt_c.html">errprt_c</a> to choose
        the output device and select the messages to output,
        respectively.

        You can also suppress the automatic output of messages
        and retrieve them directly in your own program.  getmsg_
        can be used for this.  To make sure that the messages
        retrieved correspond to the FIRST error that occurred,
        use &quot;RETURN&quot; mode.  In &quot;REPORT&quot; mode, new messages
        overwrite old ones in the CSPICE message storage
        area, so getmsg_ will get the messages from the LATEST
        error that occurred.
</PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
   1.  Setting up &quot;ABORT&quot; mode:

          /.
          We wish to have our program abort if an error
          is detected.  But instead of having the error
          messages printed on the screen, we want them
          to be written to the file, ERROR_LOG.TXT

          We want to see all of the messages, so we
          call <a href="errprt_c.html">errprt_c</a>, using the &quot;ALL&quot; option.

          Finally, we call <b>erract_c</b> to set the action to &quot;ABORT&quot;:
          ./

          <a href="errdev_c.html">errdev_c</a> ( &quot;SET&quot;, lenout, &quot;ERROR_LOG.DAT&quot; );

          <a href="errprt_c.html">errprt_c</a> ( &quot;SET&quot;, lenout, &quot;ALL&quot; );

          <b>erract_c</b> ( &quot;SET&quot;, lenout, &quot;ABORT&quot; );



   2.  Setting up &quot;REPORT&quot; mode:

          <a href="errdev_c.html">errdev_c</a> ( &quot;SET&quot;, lenout, &quot;ERROR_LOG.DAT&quot; );

          <a href="errprt_c.html">errprt_c</a> ( &quot;SET&quot;, lenout, &quot;ALL&quot;  );

          <b>erract_c</b> ( &quot;SET&quot;, lenout, &quot;REPORT&quot; );


   3.  Setting up &quot;RETURN&quot; mode:  This is the same
       as example #2, except that the <b>erract_c</b> call becomes:

          <b>erract_c</b> ( &quot;SET&quot;, lenout, &quot;RETURN&quot; );



   4.  Setting up &quot;IGNORE&quot; mode:

          /.
          In this case, we aren't going to have
          ANY error messages (unless the call
          to <b>erract_c</b> itself fails), so we don't
          really need to call <a href="errprt_c.html">errprt_c</a> and <a href="errdev_c.html">errdev_c</a>.
          (If the call to <b>erract_c</b> DOES fail, which
          it can do only if we misspell &quot;IGNORE,&quot;
          the resulting error messages will go to
          the screen).
          ./

          <b>erract_c</b> ( &quot;SET&quot;, lenout, &quot;IGNORE&quot; );
</PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
   N.J. Bachman    (JPL)
   K.R. Gehringer  (JPL)
</PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 1.3.1, 25-SEP-2003 (EDW)

      Corrected confusing description of 'lenout' argument.

   -CSPICE Version 1.3.0, 24-JUN-2003 (NJB)

      Bug fix:  case of invalid operation keyword is now 
      diagnosed, as per the Exceptions section of the header.

   -CSPICE Version 1.2.0, 09-FEB-1998 (NJB)

      Re-implemented routine without dynamically allocated, temporary
      strings.  Made various header fixes.

   -CSPICE Version 1.0.1, 30-OCT-1997 (EDW)

      Corrected errors in examples in which the call sequence
      was incorrect.

   -CSPICE Version 1.0.0, 25-OCT-1997 (EDW)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
   get/set default error action
</PRE>
<h4>Link to routine erract_c source file <a href='../../../src/cspice/erract_c.c'>erract_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:23 2010</pre>

</body>
</html>

